import {
  createStore
} from 'vuex'
import axios from 'axios'
import persist from 'vuex-persistedstate'
export default createStore({
  state: {
    objList: []
  },
  mutations: {
    history(state, value) {
      let flag = false
      state.objList.forEach((item) => {
        if (item == value ) {
          flag = true
        }
      })
      if (!flag && value != "") {
        state.objList.push(value)
      }
    },


    remove(state, i) {
      state.objList.splice(i, 1)
    },

    removeAll(state) {
      state.objList = []
    }
  },


  actions: {


  },
  plugins: [persist()]


})